let AudioManager = require("AudioManager");
let WX = require("WX");

cc.Class({
    extends: cc.Component,

    properties: {
        audioIcon: cc.Node,
        vibrateIcon: cc.Node,
        removeAdsIcon: cc.Node
    },


    onLoad () {},

    start () {

    },

    toggleAudio(){
        if(AudioManager.instance.canPlayAudio){
            this.audioIcon.opacity = 180;
        }else{
            this.audioIcon.opacity = 255;
        }
        AudioManager.instance.toggle();
    },

    toggleVibrate(){
        if(WX.canVibrate){
            this.vibrateIcon.opacity = 180;
            WX.canVibrate = false;
        }else{
            this.vibrateIcon.opacity = 255;
            WX.canVibrate = true;
        }
    },

    // update (dt) {},
});
